<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: base  EventListener   (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1316139452.16" />
	<link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1316139452.16" />

    <script type="text/javascript" src="assets/api-js?stamp=1316139452.16"></script>
    <script type="text/javascript" src="assets/ac-js?stamp=1316139452.16"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="g-javascript-lib">g-javascript-lib</a></h1>
        <h3>base&nbsp; <span class="subtitle">1.0.0</span></h3>
        <a href="./index.html" title="g-javascript-lib">g-javascript-lib</a> 
            &gt; <a href="./module_base.html" title="base">base</a>
                 &gt; EventListener 
                
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <h2>
                        

                        
                        
                            Class <b property="yui:name">EventListener</b>
                        <span class="extends">
                        </span>

                    </h2>
                    <!-- class tree goes here -->
                    
                
  

                    <div class="summary description" property="yui:description">
                        An interface for general G object that can fire events and 
bind event handler.
                    </div>

                    
                    <div rel="yui:properties" resource="#properties">

                    </div>

                    <div rel="yui:methods" resource="#methods">
                        <div class="section method details">
                            <h3 id="methods">Methods</h3>
                            <div class="content">
                                    <div class="" rel="yui:method" resource="#method___listen">
                                    <h4>
                                        <a name="method___listen">__listen</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong property="yui:name">__listen</strong>
                                           (
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            A class inherited form G.Base.EventListener should override this 
If something need to do before start monitor on some events.
                                        </div>

                                        <div class="description">


                                                <dl>
                                                    <dt>Returns:
                                                    <code property="yui:return">
                                                        void
                                                    </code></dt>
                                                    <dd property="yui:returnInfo"></dd>
                                                </dl>


             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method___unlisten">
                                    <h4>
                                        <a name="method___unlisten">__unlisten</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong property="yui:name">__unlisten</strong>
                                           (
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            A class inherited form G.Base.EventListener should override this 
If something need to do before stop monitor on some events.
                                        </div>

                                        <div class="description">


                                                <dl>
                                                    <dt>Returns:
                                                    <code property="yui:return">
                                                        void
                                                    </code></dt>
                                                    <dd property="yui:returnInfo"></dd>
                                                </dl>


             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_bind">
                                    <h4>
                                        <a name="method_bind">bind</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong property="yui:name">bind</strong>
                                           (
                                                
                                                        
                                                         evname
                                                    
                                                
                                                        , 
                                                         func
                                                    
                                                
                                                        , 
                                                         obj
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            <P>Bind an Object and it's function to a event handler. The event handler is
the combination of an Object and an function.</P>
<P>An EventListener maintain a list of event handlers for every different 
event. If the event was binded to a handler at the first time, listen will
be called. If the last event handler was unbinded, the unlisten will be called
</P>
                                        </div>

                                        <div class="description">

                                                <dl rel="yui:parameters">
                                                    <dt>Parameters:</dt>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">evname</span>
                                                        &lt;<span property="yui:type">string</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  the name of the event</span>
                                                        </dd>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">func</span>
                                                        &lt;<span property="yui:type">function</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  which function will be called when the event occur.</span>
                                                        </dd>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">obj</span>
                                                        &lt;<span property="yui:type">object</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  what is the "this" point to in func.</span>
                                                        </dd>
                                                </dl>

                                                <dl>
                                                    <dt>Returns:
                                                    <code property="yui:return">
                                                        void
                                                    </code></dt>
                                                    <dd property="yui:returnInfo"></dd>
                                                </dl>


             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_fire">
                                    <h4>
                                        <a name="method_fire">fire</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong property="yui:name">fire</strong>
                                           (
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Fire a event, and call all the handlers binded to it.
                                        </div>

                                        <div class="description">


                                                <dl>
                                                    <dt>Returns:
                                                    <code property="yui:return">
                                                        void
                                                    </code></dt>
                                                    <dd property="yui:returnInfo"></dd>
                                                </dl>


             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_unbind">
                                    <h4>
                                        <a name="method_unbind">unbind</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong property="yui:name">unbind</strong>
                                           (
                                                
                                                        
                                                         evname
                                                    
                                                
                                                        , 
                                                         func
                                                    
                                                
                                                        , 
                                                         obj
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Unbind an event handler for the event with given name. If all the 
handler for this event was removed, the unlisten(evname) will be called.
                                        </div>

                                        <div class="description">

                                                <dl rel="yui:parameters">
                                                    <dt>Parameters:</dt>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">evname</span>
                                                        &lt;<span property="yui:type">string</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  name of the event</span>
                                                        </dd>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">func</span>
                                                        &lt;<span property="yui:type">function</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  function of the event handler</span>
                                                        </dd>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">obj</span>
                                                        &lt;<span property="yui:type">object</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  object of the event handler</span>
                                                        </dd>
                                                </dl>

                                                <dl>
                                                    <dt>Returns:
                                                    <code property="yui:return">
                                                        void
                                                    </code></dt>
                                                    <dd property="yui:returnInfo"></dd>
                                                </dl>


             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                            </div>
                        </div>

                    </div>

                    <div rel="yui:events" resource="#events">


                    </div>

                    <div rel="yui:attributes" resource="#configattributes">

                    </div>

			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class="selected"><a href="module_base.html" title="base">base</a></li>
                                <li class=""><a href="module_svg.html" title="svg">svg</a></li>
                                <li class=""><a href="module_test.html" title="test">test</a></li>
                                <li class=""><a href="module_utils.html" title="utils">utils</a></li>
                                <li class=""><a href="module_widget.html" title="widget">widget</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="DOM.Element.html" title="DOM.Element">DOM.Element</a></li>
                                <li class="selected"><a href="EventListener.html" title="EventListener">EventListener</a></li>
                                <li class=""><a href="G.html" title="G">G</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="board.js.html" title="board.js">board.js</a></li>
                                <li class=""><a href="dom.js.html" title="dom.js">dom.js</a></li>
                                <li class=""><a href="g.js.html" title="g.js">g.js</a></li>
                        </ul>
                    </div>


                    <div id="methodsList" class="module">
                        <h4>Methods</h4>
                        <ul class="content">        
                                <li class=""><a href="#method___listen" title="__listen">__listen</a></li>
                                <li class=""><a href="#method___unlisten" title="__unlisten">__unlisten</a></li>
                                <li class=""><a href="#method_bind" title="bind">bind</a></li>
                                <li class=""><a href="#method_fire" title="fire">fire</a></li>
                                <li class=""><a href="#method_unbind" title="unbind">unbind</a></li>
                        </ul>
                    </div>



            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2011 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">
    ALL_YUI_PROPS = [{"url": "EventListener.html#method_bind", "access": "", "host": "EventListener", "type": "method", "name": "bind"}, {"url": "DOM.Element.html#method_disable_drag", "access": "", "host": "DOM.Element", "type": "method", "name": "disable_drag"}, {"url": "DOM.Element.html#method_enable_drag", "access": "", "host": "DOM.Element", "type": "method", "name": "enable_drag"}, {"url": "EventListener.html#method_fire", "access": "", "host": "EventListener", "type": "method", "name": "fire"}, {"url": "G.html#method_GClass", "access": "", "host": "G", "type": "method", "name": "GClass"}, {"url": "DOM.Element.html#method_get_mouse", "access": "", "host": "DOM.Element", "type": "method", "name": "get_mouse"}, {"url": "DOM.Element.html#method_get_offset_in_page", "access": "", "host": "DOM.Element", "type": "method", "name": "get_offset_in_page"}, {"url": "G.html#method_get_uuid", "access": "", "host": "G", "type": "method", "name": "get_uuid"}, {"url": "DOM.Element.html#method___init", "access": "", "host": "DOM.Element", "type": "method", "name": "__init"}, {"url": "EventListener.html#method___listen", "access": "", "host": "EventListener", "type": "method", "name": "__listen"}, {"url": "G.html#method_Namespace", "access": "", "host": "G", "type": "method", "name": "Namespace"}, {"url": "DOM.Element.html#method_reg_resize_check", "access": "", "host": "DOM.Element", "type": "method", "name": "reg_resize_check"}, {"url": "EventListener.html#method_unbind", "access": "", "host": "EventListener", "type": "method", "name": "unbind"}, {"url": "EventListener.html#method___unlisten", "access": "", "host": "EventListener", "type": "method", "name": "__unlisten"}, {"url": "DOM.Element.html#method_unreg_resize_check", "access": "", "host": "DOM.Element", "type": "method", "name": "unreg_resize_check"}];
</script>
</body>
</html>
